<template>
  <el-select
    v-model="value"
    placeholder="请选择"
    clearable
    :size="$attrs.size"
    :disabled="$attrs.disabled"
    :multiple="$attrs.multiple"
    :filterable="$attrs.filterable"
    @change="handleChange"
  >
    <el-option
      v-for="(item, index) in $attrs.options"
      :key="index"
      :label="item.label"
      :value="item.value"
    />
  </el-select>
</template>

<script>
export default {
  name: 'YlSelect',
  data () {
    return {
      value: ''
    }
  },
  methods: {
    // 改变所选中的值
    handleChange (val) {
      this.$emit('value-change', val)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
